import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/co_chemicals_entity.dart';
import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';


CoChemicalsEntity $CoChemicalsEntityFromJson(Map<String, dynamic> json) {
  final CoChemicalsEntity coChemicalsEntity = CoChemicalsEntity();
  final String? alias = jsonConvert.convert<String>(json['alias']);
  if (alias != null) {
    coChemicalsEntity.alias = alias;
  }
  final String? cas = jsonConvert.convert<String>(json['cas']);
  if (cas != null) {
    coChemicalsEntity.cas = cas;
  }
  final String? chemicalsName = jsonConvert.convert<String>(json['chemicalsName']);
  if (chemicalsName != null) {
    coChemicalsEntity.chemicalsName = chemicalsName;
  }
  final String? chemicalsSpecies = jsonConvert.convert<String>(json['chemicalsSpecies']);
  if (chemicalsSpecies != null) {
    coChemicalsEntity.chemicalsSpecies = chemicalsSpecies;
  }
  final String? chemicalsType = jsonConvert.convert<String>(json['chemicalsType']);
  if (chemicalsType != null) {
    coChemicalsEntity.chemicalsType = chemicalsType;
  }
  final String? chemicalsTypeLabel = jsonConvert.convert<String>(json['chemicalsTypeLabel']);
  if (chemicalsTypeLabel != null) {
    coChemicalsEntity.chemicalsTypeLabel = chemicalsTypeLabel;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    coChemicalsEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    coChemicalsEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    coChemicalsEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    coChemicalsEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    coChemicalsEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    coChemicalsEntity.id = id;
  }
  final int? keySupervision = jsonConvert.convert<int>(json['keySupervision']);
  if (keySupervision != null) {
    coChemicalsEntity.keySupervision = keySupervision;
  }
  final String? labelUrl = jsonConvert.convert<String>(json['labelUrl']);
  if (labelUrl != null) {
    coChemicalsEntity.labelUrl = labelUrl;
  }
  final String? majorId = jsonConvert.convert<String>(json['majorId']);
  if (majorId != null) {
    coChemicalsEntity.majorId = majorId;
  }
  final String? maxReservesFang = jsonConvert.convert<String>(json['maxReservesFang']);
  if (maxReservesFang != null) {
    coChemicalsEntity.maxReservesFang = maxReservesFang;
  }
  final String? maxReservesTon = jsonConvert.convert<String>(json['maxReservesTon']);
  if (maxReservesTon != null) {
    coChemicalsEntity.maxReservesTon = maxReservesTon;
  }
  final int? msdsId = jsonConvert.convert<int>(json['msdsId']);
  if (msdsId != null) {
    coChemicalsEntity.msdsId = msdsId;
  }
  final String? productionCapacityFang = jsonConvert.convert<String>(json['productionCapacityFang']);
  if (productionCapacityFang != null) {
    coChemicalsEntity.productionCapacityFang = productionCapacityFang;
  }
  final String? productionCapacityTon = jsonConvert.convert<String>(json['productionCapacityTon']);
  if (productionCapacityTon != null) {
    coChemicalsEntity.productionCapacityTon = productionCapacityTon;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    coChemicalsEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    coChemicalsEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    coChemicalsEntity.updateDate = updateDate;
  }
  final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
  if (isSelected != null) {
    coChemicalsEntity.isSelected = isSelected;
  }
  return coChemicalsEntity;
}

Map<String, dynamic> $CoChemicalsEntityToJson(CoChemicalsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['alias'] = entity.alias;
  data['cas'] = entity.cas;
  data['chemicalsName'] = entity.chemicalsName;
  data['chemicalsSpecies'] = entity.chemicalsSpecies;
  data['chemicalsType'] = entity.chemicalsType;
  data['chemicalsTypeLabel'] = entity.chemicalsTypeLabel;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['keySupervision'] = entity.keySupervision;
  data['labelUrl'] = entity.labelUrl;
  data['majorId'] = entity.majorId;
  data['maxReservesFang'] = entity.maxReservesFang;
  data['maxReservesTon'] = entity.maxReservesTon;
  data['msdsId'] = entity.msdsId;
  data['productionCapacityFang'] = entity.productionCapacityFang;
  data['productionCapacityTon'] = entity.productionCapacityTon;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['isSelected'] = entity.isSelected;
  return data;
}

extension CoChemicalsEntityExtension on CoChemicalsEntity {
  CoChemicalsEntity copyWith({
    String? alias,
    String? cas,
    String? chemicalsName,
    String? chemicalsSpecies,
    String? chemicalsType,
    String? chemicalsTypeLabel,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    int? keySupervision,
    String? labelUrl,
    String? majorId,
    String? maxReservesFang,
    String? maxReservesTon,
    int? msdsId,
    String? productionCapacityFang,
    String? productionCapacityTon,
    String? updateBy,
    String? updateById,
    String? updateDate,
    bool? isSelected,
  }) {
    return CoChemicalsEntity()
      ..alias = alias ?? this.alias
      ..cas = cas ?? this.cas
      ..chemicalsName = chemicalsName ?? this.chemicalsName
      ..chemicalsSpecies = chemicalsSpecies ?? this.chemicalsSpecies
      ..chemicalsType = chemicalsType ?? this.chemicalsType
      ..chemicalsTypeLabel = chemicalsTypeLabel ?? this.chemicalsTypeLabel
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..keySupervision = keySupervision ?? this.keySupervision
      ..labelUrl = labelUrl ?? this.labelUrl
      ..majorId = majorId ?? this.majorId
      ..maxReservesFang = maxReservesFang ?? this.maxReservesFang
      ..maxReservesTon = maxReservesTon ?? this.maxReservesTon
      ..msdsId = msdsId ?? this.msdsId
      ..productionCapacityFang = productionCapacityFang ?? this.productionCapacityFang
      ..productionCapacityTon = productionCapacityTon ?? this.productionCapacityTon
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..isSelected = isSelected ?? this.isSelected;
  }
}
